﻿using System;
using System.Collections.Generic;
using System.Linq;

using PortalIntranet.DatabaseComponents.WebParts;
using PortalIntranet.DatabaseComponents.Seguranca;
using PortalIntranet.BusinessComponents.Seguranca;
using PortalIntranet.ObjectComponents.WebParts.Ramais;

namespace PortalIntranet.BusinessComponents.WebParts.Ramais
{
	public class RamaisBll
	{
		public static WPRamais ConverterWebPart(int empresa, WebPart webpart)
		{
			List<Usuario> usuarios = UsuariosBll.ListarTodos(empresa);
			WPRamais wpramal = new WPRamais(webpart);

			foreach (var item in usuarios)
			{
				wpramal.Ramais.Add(new RamalInfo(item));
			}

			return wpramal;
		}
	}
}
